          
          
         
          var originalWidth = consultWidth = window.innerWidth;
          var linkJumpCount = 16;
          var linkHref;
          var beginningDelay = null;
          var animateDelayCount = 4000;
          //var watchBrowse = null;
          function countDown(){
                linkJumpCount -= 1;
               
                //linkJumpCount=0时，跳转页面
                if(linkJumpCount <= 0){
                    location.href = linkHref;
                }

                //每秒执行一次,showTime()
                setTimeout("countDown()",100);
            }
            //禁止滚动
            function bodyScroll(event) {
                　event.preventDefault();
            }
            //内容高度是否小于屏幕高度
            function checkContnHeight(){
                if($('.container')[0].offsetHeight < window.innerHeight){
                    $('.container').addClass('fillAll');
                }
            }
            //判断是否为移动设备
            function browserRedirect(){
                var sUserAgent = navigator.userAgent.toLowerCase();
                var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
                var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
                var bIsMidp = sUserAgent.match(/midp/i) == "midp";
                var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
                var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
                var bIsAndroid = sUserAgent.match(/android/i) == "android";
                var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
                var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
                if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                    $('body').addClass('mobileDevice');
                    return true;
                }else{
                    return false;
                }
            }
            
            $(document).ready(function(){
                    browserRedirect();
                    setTimeout(checkContnHeight,10);
                    setTimeout(function(){
                        window.scrollTo(0,0);
                    },50);
                    $('a').click(function(e){
                            linkHref = $(this).attr('href');
                            e = e || window.event;
                            e.cancelBubble = true;
                            e.stopPropagation();
                            if(e.preventDefault){ // w3c
                                e.preventDefault();
                            } else { // ie
                                e.returnValue = false;
                            }
                            countDown();
                            $('header nav a').removeClass('current');
                            $('header nav a').removeClass('click');
                            for(var a = 0;a < $('header nav a').length;a++){
                                var href = $('header nav a')[a].getAttribute('href').split('.')[0];
                                if(linkHref.indexOf(href) >= 0){
                                    $('header nav a:eq(' + a + ')').addClass('click');
                                }else if(href.indexOf('project') >= 0 && linkHref.indexOf('project') >= 0){
                                    $('header nav a:eq(' + a + ')').addClass('click');
                                }
                            }
                            if(window.location.href.indexOf('index') >= 0 && linkHref.indexOf('index') < 0){
                                $('header nav a').css('color','#8d8d8d');
                            }else if(linkHref.indexOf('index') >= 0){
                                $('header nav a').css('color','#fff');
                            }
                            $('.leaving').addClass('jump');
                            $('.container').addClass('jump');
                    })
                    $('header nav .btn').click(function(){
                        if($(this).parent()[0].className.indexOf('flip') < 0){
                            $(this).parent().addClass('flip');
                        }else{
                            $(this).parent().removeClass('flip');
                        }
                    })
                    var linkNow = window.location.href;
                    console.log(linkNow);
                    for(var l = 0;l < $('header nav ul li a').length;l++){
                        var href = $('header nav ul li a')[l].getAttribute('href').split('.')[0];
                        if(linkNow.indexOf(href) >= 0){
                            $('header nav ul li a:eq(' + l +')').addClass('current');
                            break;
                        }else if(linkNow.indexOf('project') >= 0 && href.indexOf('project') >= 0){
                            $('header nav ul li a:eq(' + l +')').addClass('current'); 
                            break
                        }
                    }
            })

            

        